voltage and current calculations